package main

import "fmt"

/*
*常规接口示例
 */

//投票者接口
type voter interface {
	vote() int
}

//管理者
type manager struct {
}

func (m manager) vote() int {
	fmt.Println("管理者参与了投票")
	return 3
}

//员工
type employee struct {
}

func (e employee) vote() int {
	fmt.Println("员工参与了投票")
	return 1
}

func main() {
	voters := []voter{manager{}, employee{}}

	for _, v := range voters {
		fmt.Println("获得票数：", v.vote())
	}

}
